 <!-- Core JS -->


<script src="/static/HubUI/js/sweetalert2.js"></script>


  <!-- build:js assets/vendor/js/core.js -->
  <script src="/static/HubUI/js/axios.min.js"></script>
  <script>
    // 设置axios的默认请求
    axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

    // 读取本地的userInfo

  </script>
  <script src="/static/HubUI/assets/vendor/libs/jquery/jquery.js"></script>
  <script src="/static/HubUI/assets/vendor/libs/popper/popper.js"></script>
  <script src="/static/HubUI/assets/vendor/js/bootstrap.js"></script>
  <script src="/static/HubUI/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
  <script src="/static/HubUI/assets/vendor/js/menu.js"></script>

  <!-- endbuild -->

  <!-- Vendors JS -->
  <script src="/static/HubUI/assets/vendor/libs/apex-charts/apexcharts.js"></script>

  <!-- Main JS -->
  <script src="/static/HubUI/assets/js/main.js"></script>

  <!-- Page JS -->
  <script src="/static/HubUI/assets/js/dashboards-analytics.js"></script>
  <script src="/static/HubUI/js/Hub.js"></script>
  <script>
    // 自定义JS
    
    // 添加请求拦截器
    axios.interceptors.request.use(async function (config) {
      // 读取本地的user
      let user = localStorage.getItem('user');
      if (user) {
        user = JSON.parse(user);
        
        config.headers['X-User-Id'] = user.user_id;
      }
      // 在发送请求之前做些什么
      return config;  
    }, function (error) {
      // 对请求错误做些什么
      return Promise.reject(error);
    });
  </script>